home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / nivb / fileinfo.frm < prev    next >
Text File  |  1995-05-07  |  12KB  |  449 lines

  1. VERSION 2.00
  2. Begin Form FileInfoForm 
  3.    Caption         =   "File Services Test"
  4.    ClientHeight    =   4110
  5.    ClientLeft      =   1080
  6.    ClientTop       =   1680
  7.    ClientWidth     =   6930
  8.    Height          =   4515
  9.    Left            =   1020
  10.    LinkTopic       =   "Form2"
  11.    ScaleHeight     =   4110
  12.    ScaleWidth      =   6930
  13.    Top             =   1335
  14.    Width           =   7050
  15.    Begin Frame Frame2 
  16.       Caption         =   "Extended File Attributes"
  17.       Height          =   1455
  18.       Left            =   3720
  19.       TabIndex        =   4
  20.       Top             =   1920
  21.       Width           =   2415
  22.       Begin CheckBox WABox 
  23.          Caption         =   "Write audit"
  24.          Height          =   255
  25.          Left            =   480
  26.          TabIndex        =   15
  27.          Top             =   1080
  28.          Width           =   1575
  29.       End
  30.       Begin CheckBox RABox 
  31.          Caption         =   "Read audit"
  32.          Height          =   255
  33.          Left            =   480
  34.          TabIndex        =   14
  35.          Top             =   840
  36.          Width           =   1575
  37.       End
  38.       Begin CheckBox IBox 
  39.          Caption         =   "Indexed"
  40.          Height          =   255
  41.          Left            =   480
  42.          TabIndex        =   13
  43.          Top             =   600
  44.          Width           =   1575
  45.       End
  46.       Begin CheckBox TBox 
  47.          Caption         =   "Transactional"
  48.          Height          =   255
  49.          Left            =   480
  50.          TabIndex        =   12
  51.          Top             =   360
  52.          Width           =   1575
  53.       End
  54.    End
  55.    Begin Frame Frame1 
  56.       Caption         =   "File Attributes"
  57.       Height          =   2175
  58.       Left            =   360
  59.       TabIndex        =   3
  60.       Top             =   1320
  61.       Width           =   1695
  62.       Begin CheckBox ShBox 
  63.          Caption         =   "Sharable"
  64.          Height          =   255
  65.          Left            =   120
  66.          TabIndex        =   11
  67.          Top             =   1800
  68.          Width           =   1455
  69.       End
  70.       Begin CheckBox ABox 
  71.          Caption         =   "Archive"
  72.          Height          =   255
  73.          Left            =   120
  74.          TabIndex        =   10
  75.          Top             =   1560
  76.          Width           =   1455
  77.       End
  78.       Begin CheckBox SubBox 
  79.          Caption         =   "Subdirectory"
  80.          Height          =   255
  81.          Left            =   120
  82.          TabIndex        =   9
  83.          Top             =   1320
  84.          Width           =   1455
  85.       End
  86.       Begin CheckBox XBox 
  87.          Caption         =   "Execute only"
  88.          Height          =   255
  89.          Left            =   120
  90.          TabIndex        =   8
  91.          Top             =   1080
  92.          Width           =   1455
  93.       End
  94.       Begin CheckBox SBox 
  95.          Caption         =   "System"
  96.          Height          =   255
  97.          Left            =   120
  98.          TabIndex        =   7
  99.          Top             =   840
  100.          Width           =   1455
  101.       End
  102.       Begin CheckBox HBox 
  103.          Caption         =   "Hidden"
  104.          Height          =   255
  105.          Left            =   120
  106.          TabIndex        =   6
  107.          Top             =   600
  108.          Width           =   1455
  109.       End
  110.       Begin CheckBox ROBox 
  111.          Caption         =   "Read-only"
  112.          Height          =   255
  113.          Left            =   120
  114.          TabIndex        =   5
  115.          Top             =   360
  116.          Width           =   1455
  117.       End
  118.    End
  119.    Begin CommandButton OKButton 
  120.       Caption         =   "&OK"
  121.       Height          =   375
  122.       Left            =   2880
  123.       TabIndex        =   0
  124.       Top             =   3600
  125.       Width           =   855
  126.    End
  127.    Begin Label OwnerLabel 
  128.       Height          =   255
  129.       Left            =   960
  130.       TabIndex        =   27
  131.       Top             =   840
  132.       Width           =   2055
  133.    End
  134.    Begin Label Label7 
  135.       Alignment       =   1  'Right Justify
  136.       Caption         =   "Owner:"
  137.       Height          =   255
  138.       Left            =   120
  139.       TabIndex        =   26
  140.       Top             =   840
  141.       Width           =   735
  142.    End
  143.    Begin Label LastArchivedLabel 
  144.       Height          =   255
  145.       Left            =   4680
  146.       TabIndex        =   25
  147.       Top             =   1560
  148.       Width           =   2055
  149.    End
  150.    Begin Label Label6 
  151.       Alignment       =   1  'Right Justify
  152.       Caption         =   "Last archived:"
  153.       Height          =   255
  154.       Left            =   3240
  155.       TabIndex        =   24
  156.       Top             =   1560
  157.       Width           =   1335
  158.    End
  159.    Begin Label LastUpdateLabel 
  160.       Height          =   255
  161.       Left            =   4680
  162.       TabIndex        =   23
  163.       Top             =   1320
  164.       Width           =   2055
  165.    End
  166.    Begin Label Label5 
  167.       Alignment       =   1  'Right Justify
  168.       Caption         =   "Last updated:"
  169.       Height          =   255
  170.       Left            =   3240
  171.       TabIndex        =   22
  172.       Top             =   1320
  173.       Width           =   1335
  174.    End
  175.    Begin Label LastAccessLabel 
  176.       Height          =   255
  177.       Left            =   4680
  178.       TabIndex        =   21
  179.       Top             =   1080
  180.       Width           =   2055
  181.    End
  182.    Begin Label Label4 
  183.       Alignment       =   1  'Right Justify
  184.       Caption         =   "Last accessed:"
  185.       Height          =   255
  186.       Left            =   3240
  187.       TabIndex        =   20
  188.       Top             =   1080
  189.       Width           =   1335
  190.    End
  191.    Begin Label CreatedLabel 
  192.       Height          =   255
  193.       Left            =   4680
  194.       TabIndex        =   19
  195.       Top             =   840
  196.       Width           =   2055
  197.    End
  198.    Begin Label Label3 
  199.       Alignment       =   1  'Right Justify
  200.       Caption         =   "Created:"
  201.       Height          =   255
  202.       Left            =   3720
  203.       TabIndex        =   18
  204.       Top             =   840
  205.       Width           =   855
  206.    End
  207.    Begin Label Label2 
  208.       Alignment       =   1  'Right Justify
  209.       Caption         =   "Size:"
  210.       Height          =   255
  211.       Left            =   240
  212.       TabIndex        =   17
  213.       Top             =   1080
  214.       Width           =   615
  215.    End
  216.    Begin Label Label1 
  217.       Caption         =   "Information for file:"
  218.       Height          =   255
  219.       Left            =   120
  220.       TabIndex        =   16
  221.       Top             =   120
  222.       Width           =   2655
  223.    End
  224.    Begin Label FileSizeLabel 
  225.       Height          =   255
  226.       Left            =   960
  227.       TabIndex        =   2
  228.       Top             =   1080
  229.       Width           =   1575
  230.    End
  231.    Begin Label FilePathLabel 
  232.       Height          =   255
  233.       Left            =   360
  234.       TabIndex        =   1
  235.       Top             =   360
  236.       Width           =   6375
  237.    End
  238. End
  239. Dim locked%
  240.  
  241. Sub ABox_Click ()
  242.     If locked% Then
  243.         locked% = False
  244.         If (Abox.Value = 0) Then
  245.             Abox.Value = 1
  246.         Else
  247.             Abox.Value = 0
  248.         End If
  249.         locked% = True
  250.     End If
  251. End Sub
  252.  
  253. Sub Form_Load ()
  254.     locked% = False
  255.  
  256.     server$ = String$(48, 0)
  257.     volume$ = String$(16, 0)
  258.     dirs$ = String$(255, 0)
  259.  
  260.     dirPath$ = SelectFileForm.CurrDirLabel.Caption + "\" + SelectFileForm.FileNameBox.Text
  261.  
  262.     cCode% = ParsePath(dirPath$, server$, volume$, dirs$)
  263.     
  264.     volume$ = Left$(volume$, InStr(volume$, Chr$(0)) - 1)
  265.     dirs$ = Left$(dirs$, InStr(dirs$, Chr$(0)) - 1)
  266.     filePath$ = volume$ + ":/" + dirs$
  267.     
  268.     fileName$ = String$(15, 0)
  269.     handle% = 0
  270.     sequence% = -1
  271.     cCode% = ScanFileInformation(handle%, filePath$, FA_NORMAL And FA_HIDDEN And FA_SYSTEM, sequence%, fileName$, attrib%, extAttrib%, size&, cDate%, lastAcc%, lastUpd&, lastArch&, ownerID&)
  272.     If (cCode% <> SUCCESSFUL) Then
  273.         MsgBox "Unable to get file information", MB_OK, "Error"
  274.